<!--
+----------------------------------------------------------------------
| 友得云客  - 开启房产营销新纪元
+----------------------------------------------------------------------
| Copyright (c) 2019~2023 优得（西安）信息科技有限公司版权所有
+----------------------------------------------------------------------
| Licensed 友得云客不是自由软件 未经允许不可移除相关版权
+----------------------------------------------------------------------
| Author: www.youdeyunke.com
+----------------------------------------------------------------------
-->
<template>
    <div class="text-module" :style="{
        'background-color': backgroundColor,
        color: fontColor,
        'font-size': fontSize,
        'font-style': fontStyle,
        'font-weight': fontWeight,
        'line-height': lineHeight,
        'letter-spacing': letterSpacing,
        'text-align': textAlign,
    }">{{ textContent }}
    </div>
</template>

<script>
export default {
    data () {
        return {
            loading: false,
        };
    },
    props: {
        module: { type: Object },
    },

    mounted: function () { },

    computed: {
        lineHeight: function () {
            var v = this.module.data.lineHeight || 150;
            return v + "%";
        },
        letterSpacing: function () {
            return this.module.data.letterSpacing + 'px'
        },
        textAlign: function () {
            var v = this.module.data.textAlign || "left";
            return v;
        },
        fontSize: function () {
            return this.module.data.fontSize + "px";
        },
        fontColor: function () {
            return this.module.data.color;
        },
        fontStyle: function () {
            var v = this.module.data.fontStyle || "normal";
            return v;
        },
        fontWeight: function () {
            var v = this.module.data.fontWeight || "normal";
            return v;
        },
        backgroundColor: function () { },
        textContent: {
            get () {
                return this.module.data.text || "请输入";
            },
            set (val) {
                this.$set(this.module.data, "text", val);
            },
        },
    },

    methods: {},
};
</script>

<style scoped>
.text-module {
    width: 710px;
    min-height: 40px;
    padding: 0 20px;
    vertical-align: middle;
}
</style>